<?php
error_reporting(0);
ini_set('display_errors', '0');
session_start();

if (!function_exists('session_unregister')) {

    function session_unregister($name) {
        unset($_SESSION[$name]);
    }

}

if (isset($_GET['mod']) && $_GET['mod'] == 'logout') {
    session_unregister("iduserlogin");
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
include_once ("../library/app_config.php");
require("../library/MySQL.dll.php");
include_once ("../library/common_function.php");

require("include/paging.cls.php");
require("include/resizejpg.php");
require("value.php");
?>
        <title>Bamix :: Administrator Panel </title>
        <link href="<?= APPLICATION_SITEADMIN_URL ?>style/style.css" rel="stylesheet" type="text/css" />
    </head>
    <script language="javascript" src="<?= APPLICATION_SITEADMIN_URL ?>js/common.js"></script>
    <script language="javascript" src="<?= APPLICATION_SITEADMIN_URL ?>js/ajax.js"></script>
    <script language="javascript">
        function calllogin() {
            var frm = document.frmlogin;
            var ok = true;
            if (frm.txtusername.value == "") {
                alert("Please, input username !");
                frm.txtusername.focus();
                ok = false;
            }
            if (ok)
                if (frm.txtpassword.value == "") {
                    alert("Please, input password !");
                    frm.txtpassword.focus();
                    ok = false;
                }
            if (ok) {
                frm.submit();
            }
        }
    </script>
</head>

<body>

    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" >
        <tr>
            <td colspan="3"><?php include("top.php"); ?>	</td>
        </tr>
<?
if (isset($_SESSION['iduserlogin'])) {
    ?>
            <tr>
                <td class="leftMenu">
            <?
            include('left.php');
            ?>
                </td>
                <td width="5" background="images/shadow_leftmenu.gif">&nbsp;</td>
                <td class="maincontent">
                    <?
                    $mainpage = "mod.php";
                    if (file_exists($mainpage))
                        include($mainpage);
                    ?>
                </td>
            </tr>
                    <?
                }
                else {
                    ?>	
            <tr>    
                <td colspan="3">
            <?
            $mainpage = "mod.php";
            if (file_exists($mainpage))
                include($mainpage);
            ?>
                </td>
            </tr>	
                    <?
                }
                ?>  

    </table>

</body>
</html>
